Termination w.r.t. Q of the following Term Rewriting System could not be shown:

Q restricted rewrite system:
The TRS R consists of the following rules:

p(0) → 0
p(s(X)) → X
leq(0, Y) → true
leq(s(X), 0) → false
leq(s(X), s(Y)) → leq(X, Y)
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
diff(X, Y) → if(leq(X, Y), n__0, n__s(n__diff(n__p(X), Y)))
0n__0
s(X) → n__s(X)
diff(X1, X2) → n__diff(X1, X2)
p(X) → n__p(X)
activate(n__0) → 0
activate(n__s(X)) → s(activate(X))
activate(n__diff(X1, X2)) → diff(activate(X1), activate(X2))
activate(n__p(X)) → p(activate(X))
activate(X) → X

Q is empty.


QTRS
  ↳ DependencyPairsProof

Q restricted rewrite system:
The TRS R consists of the following rules:

p(0) → 0
p(s(X)) → X
leq(0, Y) → true
leq(s(X), 0) → false
leq(s(X), s(Y)) → leq(X, Y)
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
diff(X, Y) → if(leq(X, Y), n__0, n__s(n__diff(n__p(X), Y)))
0n__0
s(X) → n__s(X)
diff(X1, X2) → n__diff(X1, X2)
p(X) → n__p(X)
activate(n__0) → 0
activate(n__s(X)) → s(activate(X))
activate(n__diff(X1, X2)) → diff(activate(X1), activate(X2))
activate(n__p(X)) → p(activate(X))
activate(X) → X

Q is empty.

Using Dependency Pairs [1,15] we result in the following initial DP problem:
Q DP problem:
The TRS P consists of the following rules:

ACTIVATE(n__s(X)) → S(activate(X))
IF(true, X, Y) → ACTIVATE(X)
DIFF(X, Y) → LEQ(X, Y)
ACTIVATE(n__diff(X1, X2)) → DIFF(activate(X1), activate(X2))
IF(false, X, Y) → ACTIVATE(Y)
ACTIVATE(n__s(X)) → ACTIVATE(X)
ACTIVATE(n__diff(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__p(X)) → P(activate(X))
ACTIVATE(n__p(X)) → ACTIVATE(X)
ACTIVATE(n__0) → 01
LEQ(s(X), s(Y)) → LEQ(X, Y)
ACTIVATE(n__diff(X1, X2)) → ACTIVATE(X2)
DIFF(X, Y) → IF(leq(X, Y), n__0, n__s(n__diff(n__p(X), Y)))

The TRS R consists of the following rules:

p(0) → 0
p(s(X)) → X
leq(0, Y) → true
leq(s(X), 0) → false
leq(s(X), s(Y)) → leq(X, Y)
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
diff(X, Y) → if(leq(X, Y), n__0, n__s(n__diff(n__p(X), Y)))
0n__0
s(X) → n__s(X)
diff(X1, X2) → n__diff(X1, X2)
p(X) → n__p(X)
activate(n__0) → 0
activate(n__s(X)) → s(activate(X))
activate(n__diff(X1, X2)) → diff(activate(X1), activate(X2))
activate(n__p(X)) → p(activate(X))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.

↳ QTRS
  ↳ DependencyPairsProof
QDP
      ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

ACTIVATE(n__s(X)) → S(activate(X))
IF(true, X, Y) → ACTIVATE(X)
DIFF(X, Y) → LEQ(X, Y)
ACTIVATE(n__diff(X1, X2)) → DIFF(activate(X1), activate(X2))
IF(false, X, Y) → ACTIVATE(Y)
ACTIVATE(n__s(X)) → ACTIVATE(X)
ACTIVATE(n__diff(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__p(X)) → P(activate(X))
ACTIVATE(n__p(X)) → ACTIVATE(X)
ACTIVATE(n__0) → 01
LEQ(s(X), s(Y)) → LEQ(X, Y)
ACTIVATE(n__diff(X1, X2)) → ACTIVATE(X2)
DIFF(X, Y) → IF(leq(X, Y), n__0, n__s(n__diff(n__p(X), Y)))

The TRS R consists of the following rules:

p(0) → 0
p(s(X)) → X
leq(0, Y) → true
leq(s(X), 0) → false
leq(s(X), s(Y)) → leq(X, Y)
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
diff(X, Y) → if(leq(X, Y), n__0, n__s(n__diff(n__p(X), Y)))
0n__0
s(X) → n__s(X)
diff(X1, X2) → n__diff(X1, X2)
p(X) → n__p(X)
activate(n__0) → 0
activate(n__s(X)) → s(activate(X))
activate(n__diff(X1, X2)) → diff(activate(X1), activate(X2))
activate(n__p(X)) → p(activate(X))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 2 SCCs with 4 less nodes.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
QDP
            ↳ UsableRulesProof
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

LEQ(s(X), s(Y)) → LEQ(X, Y)

The TRS R consists of the following rules:

p(0) → 0
p(s(X)) → X
leq(0, Y) → true
leq(s(X), 0) → false
leq(s(X), s(Y)) → leq(X, Y)
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
diff(X, Y) → if(leq(X, Y), n__0, n__s(n__diff(n__p(X), Y)))
0n__0
s(X) → n__s(X)
diff(X1, X2) → n__diff(X1, X2)
p(X) → n__p(X)
activate(n__0) → 0
activate(n__s(X)) → s(activate(X))
activate(n__diff(X1, X2)) → diff(activate(X1), activate(X2))
activate(n__p(X)) → p(activate(X))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We can use the usable rules and reduction pair processor [15] with the Ce-compatible extension of the polynomial order that maps every function symbol to the sum of its argument. Then, we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
            ↳ UsableRulesProof
QDP
                ↳ QDPSizeChangeProof
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

LEQ(s(X), s(Y)) → LEQ(X, Y)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
QDP
            ↳ Instantiation

Q DP problem:
The TRS P consists of the following rules:

ACTIVATE(n__p(X)) → ACTIVATE(X)
ACTIVATE(n__diff(X1, X2)) → ACTIVATE(X2)
IF(true, X, Y) → ACTIVATE(X)
ACTIVATE(n__diff(X1, X2)) → DIFF(activate(X1), activate(X2))
DIFF(X, Y) → IF(leq(X, Y), n__0, n__s(n__diff(n__p(X), Y)))
IF(false, X, Y) → ACTIVATE(Y)
ACTIVATE(n__diff(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__s(X)) → ACTIVATE(X)

The TRS R consists of the following rules:

p(0) → 0
p(s(X)) → X
leq(0, Y) → true
leq(s(X), 0) → false
leq(s(X), s(Y)) → leq(X, Y)
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
diff(X, Y) → if(leq(X, Y), n__0, n__s(n__diff(n__p(X), Y)))
0n__0
s(X) → n__s(X)
diff(X1, X2) → n__diff(X1, X2)
p(X) → n__p(X)
activate(n__0) → 0
activate(n__s(X)) → s(activate(X))
activate(n__diff(X1, X2)) → diff(activate(X1), activate(X2))
activate(n__p(X)) → p(activate(X))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By instantiating [15] the rule IF(true, X, Y) → ACTIVATE(X) we obtained the following new rules:

IF(true, n__0, n__s(n__diff(n__p(y_3), y_4))) → ACTIVATE(n__0)



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
            ↳ Instantiation
QDP
                ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

IF(true, n__0, n__s(n__diff(n__p(y_3), y_4))) → ACTIVATE(n__0)
ACTIVATE(n__p(X)) → ACTIVATE(X)
ACTIVATE(n__diff(X1, X2)) → ACTIVATE(X2)
ACTIVATE(n__diff(X1, X2)) → DIFF(activate(X1), activate(X2))
DIFF(X, Y) → IF(leq(X, Y), n__0, n__s(n__diff(n__p(X), Y)))
IF(false, X, Y) → ACTIVATE(Y)
ACTIVATE(n__s(X)) → ACTIVATE(X)
ACTIVATE(n__diff(X1, X2)) → ACTIVATE(X1)

The TRS R consists of the following rules:

p(0) → 0
p(s(X)) → X
leq(0, Y) → true
leq(s(X), 0) → false
leq(s(X), s(Y)) → leq(X, Y)
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
diff(X, Y) → if(leq(X, Y), n__0, n__s(n__diff(n__p(X), Y)))
0n__0
s(X) → n__s(X)
diff(X1, X2) → n__diff(X1, X2)
p(X) → n__p(X)
activate(n__0) → 0
activate(n__s(X)) → s(activate(X))
activate(n__diff(X1, X2)) → diff(activate(X1), activate(X2))
activate(n__p(X)) → p(activate(X))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 1 SCC with 1 less node.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
            ↳ Instantiation
              ↳ QDP
                ↳ DependencyGraphProof
QDP
                    ↳ QDPOrderProof

Q DP problem:
The TRS P consists of the following rules:

ACTIVATE(n__p(X)) → ACTIVATE(X)
ACTIVATE(n__diff(X1, X2)) → ACTIVATE(X2)
ACTIVATE(n__diff(X1, X2)) → DIFF(activate(X1), activate(X2))
DIFF(X, Y) → IF(leq(X, Y), n__0, n__s(n__diff(n__p(X), Y)))
IF(false, X, Y) → ACTIVATE(Y)
ACTIVATE(n__diff(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__s(X)) → ACTIVATE(X)

The TRS R consists of the following rules:

p(0) → 0
p(s(X)) → X
leq(0, Y) → true
leq(s(X), 0) → false
leq(s(X), s(Y)) → leq(X, Y)
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
diff(X, Y) → if(leq(X, Y), n__0, n__s(n__diff(n__p(X), Y)))
0n__0
s(X) → n__s(X)
diff(X1, X2) → n__diff(X1, X2)
p(X) → n__p(X)
activate(n__0) → 0
activate(n__s(X)) → s(activate(X))
activate(n__diff(X1, X2)) → diff(activate(X1), activate(X2))
activate(n__p(X)) → p(activate(X))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


ACTIVATE(n__diff(X1, X2)) → ACTIVATE(X2)
ACTIVATE(n__diff(X1, X2)) → ACTIVATE(X1)
The remaining pairs can at least be oriented weakly.

ACTIVATE(n__p(X)) → ACTIVATE(X)
ACTIVATE(n__diff(X1, X2)) → DIFF(activate(X1), activate(X2))
DIFF(X, Y) → IF(leq(X, Y), n__0, n__s(n__diff(n__p(X), Y)))
IF(false, X, Y) → ACTIVATE(Y)
ACTIVATE(n__s(X)) → ACTIVATE(X)
Used ordering: Polynomial interpretation [25]:

POL(0) = 0   
POL(ACTIVATE(x1)) = x1   
POL(DIFF(x1, x2)) = 1 + x1 + x2   
POL(IF(x1, x2, x3)) = x3   
POL(activate(x1)) = x1   
POL(diff(x1, x2)) = 1 + x1 + x2   
POL(false) = 0   
POL(if(x1, x2, x3)) = x2 + x3   
POL(leq(x1, x2)) = 0   
POL(n__0) = 0   
POL(n__diff(x1, x2)) = 1 + x1 + x2   
POL(n__p(x1)) = x1   
POL(n__s(x1)) = x1   
POL(p(x1)) = x1   
POL(s(x1)) = x1   
POL(true) = 0   

The following usable rules [17] were oriented:

p(0) → 0
p(s(X)) → X
0n__0
activate(n__0) → 0
p(X) → n__p(X)
diff(X1, X2) → n__diff(X1, X2)
s(X) → n__s(X)
activate(X) → X
activate(n__p(X)) → p(activate(X))
if(false, X, Y) → activate(Y)
activate(n__diff(X1, X2)) → diff(activate(X1), activate(X2))
diff(X, Y) → if(leq(X, Y), n__0, n__s(n__diff(n__p(X), Y)))
if(true, X, Y) → activate(X)
activate(n__s(X)) → s(activate(X))



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
            ↳ Instantiation
              ↳ QDP
                ↳ DependencyGraphProof
                  ↳ QDP
                    ↳ QDPOrderProof
QDP
                        ↳ QDPOrderProof

Q DP problem:
The TRS P consists of the following rules:

ACTIVATE(n__p(X)) → ACTIVATE(X)
ACTIVATE(n__diff(X1, X2)) → DIFF(activate(X1), activate(X2))
DIFF(X, Y) → IF(leq(X, Y), n__0, n__s(n__diff(n__p(X), Y)))
IF(false, X, Y) → ACTIVATE(Y)
ACTIVATE(n__s(X)) → ACTIVATE(X)

The TRS R consists of the following rules:

p(0) → 0
p(s(X)) → X
leq(0, Y) → true
leq(s(X), 0) → false
leq(s(X), s(Y)) → leq(X, Y)
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
diff(X, Y) → if(leq(X, Y), n__0, n__s(n__diff(n__p(X), Y)))
0n__0
s(X) → n__s(X)
diff(X1, X2) → n__diff(X1, X2)
p(X) → n__p(X)
activate(n__0) → 0
activate(n__s(X)) → s(activate(X))
activate(n__diff(X1, X2)) → diff(activate(X1), activate(X2))
activate(n__p(X)) → p(activate(X))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


ACTIVATE(n__p(X)) → ACTIVATE(X)
The remaining pairs can at least be oriented weakly.

ACTIVATE(n__diff(X1, X2)) → DIFF(activate(X1), activate(X2))
DIFF(X, Y) → IF(leq(X, Y), n__0, n__s(n__diff(n__p(X), Y)))
IF(false, X, Y) → ACTIVATE(Y)
ACTIVATE(n__s(X)) → ACTIVATE(X)
Used ordering: Polynomial interpretation [25]:

POL(0) = 0   
POL(ACTIVATE(x1)) = x1   
POL(DIFF(x1, x2)) = 0   
POL(IF(x1, x2, x3)) = x3   
POL(activate(x1)) = 0   
POL(diff(x1, x2)) = 0   
POL(false) = 0   
POL(if(x1, x2, x3)) = 0   
POL(leq(x1, x2)) = 0   
POL(n__0) = 0   
POL(n__diff(x1, x2)) = 0   
POL(n__p(x1)) = 1 + x1   
POL(n__s(x1)) = x1   
POL(p(x1)) = 0   
POL(s(x1)) = 0   
POL(true) = 0   

The following usable rules [17] were oriented: none



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
            ↳ Instantiation
              ↳ QDP
                ↳ DependencyGraphProof
                  ↳ QDP
                    ↳ QDPOrderProof
                      ↳ QDP
                        ↳ QDPOrderProof
QDP
                            ↳ Instantiation

Q DP problem:
The TRS P consists of the following rules:

ACTIVATE(n__diff(X1, X2)) → DIFF(activate(X1), activate(X2))
DIFF(X, Y) → IF(leq(X, Y), n__0, n__s(n__diff(n__p(X), Y)))
IF(false, X, Y) → ACTIVATE(Y)
ACTIVATE(n__s(X)) → ACTIVATE(X)

The TRS R consists of the following rules:

p(0) → 0
p(s(X)) → X
leq(0, Y) → true
leq(s(X), 0) → false
leq(s(X), s(Y)) → leq(X, Y)
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
diff(X, Y) → if(leq(X, Y), n__0, n__s(n__diff(n__p(X), Y)))
0n__0
s(X) → n__s(X)
diff(X1, X2) → n__diff(X1, X2)
p(X) → n__p(X)
activate(n__0) → 0
activate(n__s(X)) → s(activate(X))
activate(n__diff(X1, X2)) → diff(activate(X1), activate(X2))
activate(n__p(X)) → p(activate(X))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By instantiating [15] the rule IF(false, X, Y) → ACTIVATE(Y) we obtained the following new rules:

IF(false, n__0, n__s(n__diff(n__p(y_3), y_4))) → ACTIVATE(n__s(n__diff(n__p(y_3), y_4)))



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
            ↳ Instantiation
              ↳ QDP
                ↳ DependencyGraphProof
                  ↳ QDP
                    ↳ QDPOrderProof
                      ↳ QDP
                        ↳ QDPOrderProof
                          ↳ QDP
                            ↳ Instantiation
QDP

Q DP problem:
The TRS P consists of the following rules:

IF(false, n__0, n__s(n__diff(n__p(y_3), y_4))) → ACTIVATE(n__s(n__diff(n__p(y_3), y_4)))
ACTIVATE(n__diff(X1, X2)) → DIFF(activate(X1), activate(X2))
DIFF(X, Y) → IF(leq(X, Y), n__0, n__s(n__diff(n__p(X), Y)))
ACTIVATE(n__s(X)) → ACTIVATE(X)

The TRS R consists of the following rules:

p(0) → 0
p(s(X)) → X
leq(0, Y) → true
leq(s(X), 0) → false
leq(s(X), s(Y)) → leq(X, Y)
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
diff(X, Y) → if(leq(X, Y), n__0, n__s(n__diff(n__p(X), Y)))
0n__0
s(X) → n__s(X)
diff(X1, X2) → n__diff(X1, X2)
p(X) → n__p(X)
activate(n__0) → 0
activate(n__s(X)) → s(activate(X))
activate(n__diff(X1, X2)) → diff(activate(X1), activate(X2))
activate(n__p(X)) → p(activate(X))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.